package com.zeldu.common.model.response;

import lombok.ToString;

/**
 * @Author: 李鸽
 * @Description: 通用的返回状态码
 * @Date:Created in 2019/1/24 18:33.
 * @Modified By:
 */

@ToString
public enum CommonCode implements ResultCode{
    INVALID_PARAM(false,10003,"参数非法! "),
    Wrong_Code(false,100005,"验证码不正确"),
    Wrong_User(false,200001,"无法获取用户信息"),
    Wrong_OldPwd(false,100008,"旧密码错误"),
    Wrong_Expire(false,100007,"验证码过期或者邮箱不正确"),
    Exist_UserName(false,100006,"用户名已存在"),
    Exist_Email(false,100007,"邮箱已经被注册"),
    Email_Wrong(false,10004,"错误的邮箱格式!"),
    AUTH_PASSWORD_NONE(false,22222,"密码不能为空"),

    SUCCESS(true,10000,"操作成功！"),

    AUTH_ACCOUNT_NOTEXISTS(false,88888,"用户不存在"),
    Wrong_TOken(false,33333,"错误的凭证"),
    AUTH_CREDENTIAL_ERROR(false,77777,"用户名或者密码错误"),
    FAIL(false,11111,"操作失败！"),
    UNAUTHENTICATED(false,10001,"此操作需要登陆系统！"),
    UNAUTHORISE(false,10002,"权限不足，无权操作！"),
    Wromg_PhoneNum(false,11111,"电话号码格式错误"),
    Wrong_Identity(false,55555,"身份不正确"),
    AUTH_LOGIN_APPLYTOKEN_FAIL(false,23007 ,"申请令牌失败" ),
    AUTH_USERNAME_NONE(false,33333,"用户名"),
    SERVER_ERROR(false,99999,"抱歉，系统繁忙，请稍后重试！");
//    private static ImmutableMap<Integer, CommonCode> codes ;
    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;
    private CommonCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }
    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }


}
